<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
    <meta name="author" content="梅子">
    <title></title>
<style>
     main{
         width: 500px;
         height: 700px;
         background-color: gray;
         margin: 0 auto;
     }
     .top-box{
         width: 402px;
         height: 445px;
         cursor: pointer;
          /*border: 1px solid black;*/
         margin: 10px auto;
         position: relative;
          background-color: white;
         text-align: center;
     }
     .info{
         width: 400px;
         height: 445px;
         /*display: none;*/
         position: absolute;
         top: 0;
         left: 0;
          border: 5px solid yellow;
          opacity: 0;
     }

     .bottom-box{
         width: 400px;
         margin: 0 auto;
         display: flex;
         background-color: white;
         /*border: 1px solid pink;*/
     }
     .bottom-box img{
         width: 170px;
         height: 170px;
         margin: 10px;
     }section{
        overflow: hidden;
         position: relative;
     }
     .ceng{
         position: absolute;
         left: 10px;
         top: 10px;
         width: 170px;
         height: 170px;
         /*line-height: 170px;*/
         background-color: #aaa;
         opacity: 0;
     }
    .bottom-box p{
         position: absolute;
         left: -100px;
         top: 70px;
    }
    
     
</style>
</head>
<body>
   <main>
        <div class="top-box">
        <img src="1.jpg" alt="">
        <p>天天开心，事事乐意。</p>
        <div class="info"></div>
    </div>
     <div class="bottom-box">
        <section><img src="2.jpg" alt=""><div class="ceng"></div><p>迎着阳光奔跑</p></section>
        <section><img src="3.jpg" alt=""><div class="ceng"></div><p>迎着阳光微笑</p></section>
    </div>
   </main>
   <script src="../jquery.js"></script>
</body>
</html>
<script>
     var isBegin=true;
      $('.top-box').hover(function(){
          if (isBegin) {
            $('.info').stop().fadeTo(1000,1);
        } else {
            $('.info').stop().fadeTo(1000,0);
        }
        isBegin = !isBegin;
    });

    //第二部分
    var index=0;
    $('.bottom-box section').each(function(index){
         $(this).hover(function(ev){
             ev.stopPropagation();
      $('.ceng').eq(index).stop().fadeTo(1000,0.8)
      $('.bottom-box p').eq(index).animate({left:60},1000)
    },function(){
       $('.ceng').eq(index).stop().fadeTo(1000,0)
        $('.bottom-box p').eq(index).animate({left:-100},1000)
    })

    })
   

</script>